<!DOCTYPE html>
<html lang="zh-cn">
   <head>
      <meta charset="utf-8">
      <meta http-equiv="X-UA-Compatible" content="IE=edge">
      <meta name="viewport" content="width=device-width, initial-scale=1">
      <title>{$CONF['mallTitle']}后台管理中心</title>
      <link href="__PUBLIC__/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet">
      <link href="__ROOT__/Apps/Admin/View/css/AdminLTE.css" rel="stylesheet" type="text/css" />
      <link rel="stylesheet" href="__ROOT__/Apps/Admin/View/css/daterangepicker/daterangepicker-bs3.css">
      <!--[if lt IE 9]>
      <script src="__PUBLIC__/js/html5shiv.min.js"></script>
      <script src="__PUBLIC__/js/respond.min.js"></script>
      <![endif]-->
      <script src="__PUBLIC__/js/jquery.min.js"></script>
      <script src="__PUBLIC__/plugins/bootstrap/js/bootstrap.min.js"></script>
      <script src="__ROOT__/Apps/Admin/View/js/daterangepicker.js"></script>
      <script src="__PUBLIC__/js/common.js"></script>
      <script src="__PUBLIC__/plugins/plugins/plugins.js"></script>
      <style type="text/css">
		#preview{border:1px solid #cccccc; background:#CCC;color:#fff; padding:5px; display:none; position:absolute;}
	  </style>
   </head>
   <script>
   function getAreaList(objId,parentId,t,id){
	   var params = {};
	   params.parentId = parentId;
	   $('#'+objId).empty();
	   if(t<1){
		   $('#areaId3').empty();
		   $('#areaId3').html('<option value="">请选择</option>');
	   }
	   var html = [];
	   $.post("{:U('Admin/Areas/queryByList')}",params,function(data,textStatus){
		    html.push('<option value="">请选择</option>');
			var json = WST.toJson(data);
			if(json.status=='1' && json.list.length>0){
				var opts = null;
				for(var i=0;i<json.list.length;i++){
					opts = json.list[i];
					html.push('<option value="'+opts.areaId+'" '+((id==opts.areaId)?'selected':'')+'>'+opts.areaName+'</option>');
				}
			}
			$('#'+objId).html(html.join(''));
	   });
   }
   $(document).ready(function(){
	   	$('#queryDate').daterangepicker({format:'YYYY-MM-DD',separator:' -> '});
	    <notempty name='areaId1'>
		   getAreaList("areaId2",'{$areaId1}',0,'{$areaId2}');
		</notempty>
   });
   </script>
   <body class='wst-page'>
   <form method='post' action="{:U('Admin/Reports/statShopSales')}">
       <div class='wst-tbar'> 
			地区：<select id='areaId1' name='areaId1' onchange='javascript:getAreaList("areaId2",this.value,0)'>
		               <option value=''>请选择</option>
		               <volist name="areaList" id="vo">
		               <option value='{$vo['areaId']}' <if condition="$areaId1 == $vo['areaId'] ">selected</if>>{$vo['areaName']}</option>
		               </volist>
		    	</select>
				<select id='areaId2' name='areaId2'>
		               <option value=''>请选择</option>
				</select>    
		       	店铺名称：<input type='text' id='shopName' name='shopName' class='form-control wst-ipt-10' value='{$shopName}'/>
		       	统计时间：<input type='text' id='queryDate' name="queryDate" class="form-control" readonly='true' style='width:200px' value='{$startDate} -> {$endDate}'/>
		  	<button type="submit" class="btn btn-primary glyphicon glyphicon-search">查询</button> 
		</div>
	</form>

  	<div class='wst-body'>
        <table class="table table-hover table-striped table-bordered wst-list">
           <thead>
             <tr>
               <th width='40'>序号</th>
               <th >店铺名称</th>
               <th >店铺编号</th>
               <th >在线支付销售额</th>
               <th >货到付款销售额</th>
               <th >总销售额</th>
               <th >订单数</th>
             </tr>
           </thead>
           <tbody>
            <volist name="Page['root']" id="vo" key='i'>
             <tr>
               <td>{$i}</td>
               <td>{$vo['shopName']}</td>
               <td>{$vo['shopSn']}&nbsp;</td>
               <td>{$vo['onlineMoney']}</td>
               <td>{$vo['unlineMoney']}</td>
               <td>{$vo['totalMoney']}</td>
               <td>{$vo['orderNum']}</td>
             </tr>
             </volist>
             <tr>
                <td colspan='7' align='center'>{$Page['pager']}</td>
             </tr>
           </tbody>
        </table>
       </div>
   </body>
</html>